package cn.com.sinux.spring.utils.image;

import java.awt.image.BufferedImage;

/**
 * @author <a href="mailto:oznyang@163.com">oznyang</a>
 */
public interface ImageTransform {
    boolean load(BufferedImage bufferedImage, String srcFilePath);

    boolean load(String srcFilePath);

    boolean save(String destFilePath);

    void resize(int width, int height) throws Exception;

    void rotate(double rotate) throws Exception;

    void resizeWithMaxWidth(int maxWidth) throws Exception;

    void rotateWithMaxWidth(double rotate, int maxWidth) throws Exception;

    /**
     * 以像素为单位截取图像.
     *
     * @param left   左坐标.
     * @param top    顶坐标.
     * @param width  宽度.
     * @param height 高度.
     */
    void crop(int left, int top, int width, int height);
}
